<html><head><title>ExplorerListGadget</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">ExplorerListGadget()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#006666"><b>ExplorerListGadget</b></font>(#Gadget, x, y, Width, Height, Directory$, [, Flags])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Creates a listing of a directory just as Explorer does. 
It lets the user choose a file or a folder and (if you do not prevent it by a flag) navigate 
through the whole directory tree. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Gadget</i></td>
<td width="90%"> 
A number to identify the new gadget. <a href="../reference/purebasic_objects.html">#PB_Any</a> can 
be used to auto-generate this number. 

</td></tr>
<tr><td><i>x, y, Width, Height</i></td>
<td> 
The position and dimensions of the new gadget. 

</td></tr>
<tr><td><i>Directory$</i></td>
<td> 
The initial displayed directory, it can include one or multiple 
patterns, like "C:\*.pb;*.pbi". If no pattern is included, the directory must 
end with a '\'. Including no directory will display the root containing the 
drives. Including no pattern defaults to '*.*'. So a Directory$ of "" will 
display the root and set '*.*' as pattern. 

</td></tr>
<tr><td><i>Flags (optional)</i></td>
<td> 
Flags to modify the gadget behavior. It can be a combination of the following values: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Explorer_BorderLess</font>          : Create Gadget without borders.
  <font color="#924B72">#PB_Explorer_AlwaysShowSelection</font> : The selection is visible, even when the gadget is not activated.
  <font color="#924B72">#PB_Explorer_MultiSelect</font>         : Enable multiple selection of items in the gadget.
  <font color="#924B72">#PB_Explorer_GridLines</font>           : Display separator lines between rows and columns.
  <font color="#924B72">#PB_Explorer_HeaderDragDrop</font>      : In report view, the headers can be changed by Drag'n'Drop.
  <font color="#924B72">#PB_Explorer_FullRowSelect</font>       : The selection covers the full row instead of the first column.

  <font color="#924B72">#PB_Explorer_NoFiles</font>             : No files will be displayed.
  <font color="#924B72">#PB_Explorer_NoFolders</font>           : No folders will be displayed.
  <font color="#924B72">#PB_Explorer_NoParentFolder</font>      : There will be no [..] link to the parent folder.
  <font color="#924B72">#PB_Explorer_NoDirectoryChange</font>   : The directory cannot be changed by the user.
  <font color="#924B72">#PB_Explorer_NoDriveRequester</font>    : There will be no 'please insert drive X:' displayed.
  <font color="#924B72">#PB_Explorer_NoSort</font>              : The user cannot sort the content by clicking on a column header.
  <font color="#924B72">#PB_Explorer_NoMyDocuments</font>       : The 'My Documents' Folder will not be displayed as a separate item.
  <font color="#924B72">#PB_Explorer_AutoSort</font>            : The content will be sorted automatically by name.
  <font color="#924B72">#PB_Explorer_HiddenFiles</font>         : Will display hidden files as well (supported on Linux and OS X only).
</font></pre>

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns nonzero on success and zero on failure. If <font color="#924B72">#PB_Any</font> was used as the #Gadget parameter 
then the return-value is the auto-generated gadget number on success. 

</blockquote><p><b>Remarks</b></p><blockquote>

A 'mini help' can be added to this gadget using <a href="gadgettooltip.html">GadgetToolTip()</a>. 
<br>
<br>
The following functions can be used to control the gadget: 
<br>
<br>
- <a href="addgadgetcolumn.html">AddGadgetColumn()</a>: Add a new automatically or custom filled column to the gadget. See the <a href="addgadgetcolumn.html">AddGadgetColumn()</a> function help for more details. 
<br>
- <a href="removegadgetcolumn.html">RemoveGadgetColumn()</a>: Remove a column from the gadget. 
<br>
- <a href="getgadgettext.html">GetGadgetText()</a>: Get the currently displayed directory. 
<br>
- <a href="setgadgettext.html">SetGadgetText()</a>: Changes the currently displayed directory, or the current pattern for files. 
<br>
- <a href="getgadgetstate.html">GetGadgetState()</a>: Get the first selected item (-1 if none selected). 
<br>
- <a href="getgadgetitemtext.html">GetGadgetItemText()</a>: Get the name of an item (or column header, if item = -1). 
<br>
- <a href="setgadgetitemtext.html">SetGadgetItemText()</a>: Alter the contents of any items text  (or column header, if item = -1), or fill a custom column with data. 
<br>
- <a href="getgadgetitemstate.html">GetGadgetItemState()</a>: Check if an item is a directory or a file, and if it is currently selected. 
<br>
- <a href="setgadgetitemstate.html">SetGadgetItemState()</a>: Change selected state of the specified item. 
<br>
- <a href="countgadgetitems.html">CountGadgetItems()</a>: Count the items in the current directory. 
<br>
- <a href="getgadgetattribute.html">GetGadgetAttribute()</a> / <a href="setgadgetattribute.html">SetGadgetAttribute()</a>: With the following attribute: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Explorer_DisplayMode</font> : Changes the display of the gadget. Can be one of the following constants:
    <font color="#924B72">#PB_Explorer_LargeIcon</font>: Large icon mode
    <font color="#924B72">#PB_Explorer_SmallIcon</font>: Small icon mode
    <font color="#924B72">#PB_Explorer_List</font>     : List icon mode
    <font color="#924B72">#PB_Explorer_Report</font>   : Report mode (columns, default mode)
</font></pre>
<br>
- <a href="getgadgetitemattribute.html">GetGadgetItemAttribute()</a> / <a href="setgadgetitemattribute.html">SetGadgetItemAttribute()</a>: With the following attribute: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Explorer_ColumnWidth</font> : Returns/Changes the width of the given 'Column'. The 'Item' parameter is ignored.
</font></pre>

<br>
This gadget supports the <a href="setgadgetcolor.html">SetGadgetColor()</a> and <a href="getgadgetcolor.html">GetGadgetColor()</a> functions with 
the following values as 'ColorType': 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Gadget_FrontColor</font>: Textcolor
  <font color="#924B72">#PB_Gadget_BackColor</font> : Backgroundcolor
  <font color="#924B72">#PB_Gadget_LineColor</font> : Color for the gridlines if the <font color="#924B72">#PB_Explorer_GridLines</font> flag is used.
</font></pre>

ExplorerListGadget() supports the following events reported by <a href="../window/eventtype.html">EventType()</a>: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_EventType_Change</font>           : The selection or the current displayed directory has changed.
  <font color="#924B72">#PB_EventType_LeftClick</font>        : User clicked on an item with the left mouse button.
  <font color="#924B72">#PB_EventType_RightClick</font>       : User clicked on an item with the right mouse button.
  <font color="#924B72">#PB_EventType_LeftDoubleClick</font>  : User double-clicked on an item with the left mouse button.
  <font color="#924B72">#PB_EventType_RightDoubleClick</font> : User double-clicked on an item with the right mouse button.
  <font color="#924B72">#PB_EventType_DragStart</font>        : User tried to start a Drag & Drop operation.
</font></pre>
After a <font color="#924B72">#PB_EventType_DragStart</font> event, the <a href="../dragdrop/index.html">Drag & Drop library</a> can be used to start 
a Drag & Drop operation. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 400, 200, "ExplorerListGadget", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#006666">    ExplorerListGadget</font>(0, 10, 10, 380, 180, "*.*", <font color="#924B72">#PB_Explorer_MultiSelect</font>)
    <b><font color="#006666">Repeat</font></b> : <b><font color="#006666">Until</font></b> <font color="#006666">WaitWindowEvent</font>() = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#006666">EndIf</font></b>
</font></pre>

<p><img src="../HelpPictures/explorerlistgadget.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="addgadgetcolumn.html">AddGadgetColumn()</a>, <a href="removegadgetcolumn.html">RemoveGadgetColumn()</a>, <a href="getgadgettext.html">GetGadgetText()</a>, <a href="setgadgettext.html">SetGadgetText()</a>, <a href="getgadgetstate.html">GetGadgetState()</a>, <a href="getgadgetitemstate.html">GetGadgetItemState()</a>, 
<a href="getgadgetitemtext.html">GetGadgetItemText()</a>, <a href="setgadgetitemtext.html">SetGadgetItemText()</a>, <a href="countgadgetitems.html">CountGadgetItems()</a>, <a href="getgadgetattribute.html">GetGadgetAttribute()</a>, <a href="setgadgetattribute.html">SetGadgetAttribute()</a>, 
<a href="getgadgetitemattribute.html">GetGadgetItemAttribute()</a>, <a href="setgadgetitemattribute.html">SetGadgetItemAttribute()</a>,<a href="setgadgetcolor.html">SetGadgetColor()</a>, <a href="setgadgetitemstate.html">SetGadgetItemState()</a>, <a href="getgadgetcolor.html">GetGadgetColor()</a>, 
<a href="explorercombogadget.html">ExplorerComboGadget()</a>, <a href="explorertreegadget.html">ExplorerTreeGadget()</a>, <a href="listicongadget.html">ListIconGadget()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=explorercombogadget.html>ExplorerComboGadget()</a> - <a href=index.html>Gadget Index</a> - <a href=explorertreegadget.html>ExplorerTreeGadget()</a> ->

</body></html>